<html>
<head><meta charset="utf-8"><title>Dataflow-based UseDef chains · t-compiler · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/index.html">t-compiler</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dataflow-based.20UseDef.20chains.html">Dataflow-based UseDef chains</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="168348630"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dataflow-based%20UseDef%20chains/near/168348630" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Dylan MacKenzie (ecstatic-morse) <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dataflow-based.20UseDef.20chains.html#168348630">(Jun 17 2019 at 21:20)</a>:</h4>
<p>On a lark, I decided to try implementing a reaching definitions analysis for <code>rustc</code>. The main use cases for this are dataflow-based const-qualification as discussed  in <a href="#narrow/stream/146212-t-compiler.2Fconst-eval/topic/dataflow-based.20const.20qualification.20MVP" title="#narrow/stream/146212-t-compiler.2Fconst-eval/topic/dataflow-based.20const.20qualification.20MVP">https://rust-lang.zulipchat.com/#narrow/stream/146212-t-compiler.2Fconst-eval/topic/dataflow-based.20const.20qualification.20MVP</a> and  better const-propagation during MIR optimization. I'll post a WIP PR when I finish adapting the <code>rustc_peek</code> machinery to my use case.</p>
<p>I wanted to let people know that someone is working on this, as well as solicit feedback on implementation strategy and other potential use cases.</p>
<p>The current analysis:<br>
    - Is field-insensitive (assignments to projections like <code>x.y = ...</code> will not kill any previous assignments to <code>x</code>, even ones like <code>x.y.z = ...</code>. I think this is not too hard to implement correctly, but I need to incorporate code from some other analyses)<br>
    - Handles pointer aliasing by killing all definitions of a variable whose address is observed at any point whenever a definition goes through a pointer (e.g. <code>*p = ...</code>) (this was proposed by eddyb on github in an issue I can no longer find)<br>
    - Is context-insensitive and very conservative w.r.t. function calls (it treats function calls just like <code>*p = ...</code>. This is because a function could take a reference (or a raw pointer) to a local as an argument and mutate it).</p>
<p>I'll post here again when I have a draft PR ready. Also, please be gentle, I've never had a compilers course :).</p>



<a name="168387893"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dataflow-based%20UseDef%20chains/near/168387893" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dataflow-based.20UseDef.20chains.html#168387893">(Jun 18 2019 at 10:32)</a>:</h4>
<p>cc <span class="user-group-mention" data-user-group-id="1162">@WG-mir-opt</span></p>



<a name="168418850"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dataflow-based%20UseDef%20chains/near/168418850" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Dylan MacKenzie (ecstatic-morse) <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dataflow-based.20UseDef.20chains.html#168418850">(Jun 18 2019 at 16:43)</a>:</h4>
<p><span class="user-mention" data-user-id="119009">@eddyb</span> <span class="user-mention" data-user-id="116083">@pnkfelix</span> Why does <code>state_for_location</code> initialize the gen and kill sets to the entry state of the basic block in question? <a href="https://github.com/rust-lang/rust/blob/44fb88d25282d9362774536965f2455f677734f3/src/librustc_mir/dataflow/mod.rs#L361-L363" target="_blank" title="https://github.com/rust-lang/rust/blob/44fb88d25282d9362774536965f2455f677734f3/src/librustc_mir/dataflow/mod.rs#L361-L363">https://github.com/rust-lang/rust/blob/44fb88d25282d9362774536965f2455f677734f3/src/librustc_mir/dataflow/mod.rs#L361-L363</a></p>



<a name="168418899"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dataflow-based%20UseDef%20chains/near/168418899" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dataflow-based.20UseDef.20chains.html#168418899">(Jun 18 2019 at 16:43)</a>:</h4>
<p>I don't actually know</p>



<a name="168418949"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dataflow-based%20UseDef%20chains/near/168418949" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dataflow-based.20UseDef.20chains.html#168418949">(Jun 18 2019 at 16:44)</a>:</h4>
<p>that might be the thing <span class="user-mention" data-user-id="116466">@Zoxc</span> added</p>



<a name="168418970"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dataflow-based%20UseDef%20chains/near/168418970" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dataflow-based.20UseDef.20chains.html#168418970">(Jun 18 2019 at 16:44)</a>:</h4>
<p>also, IIRC <span class="user-mention" data-user-id="123586">@nagisa</span> tried  to add a "reaching definition" analysis</p>



<a name="168418980"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dataflow-based%20UseDef%20chains/near/168418980" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dataflow-based.20UseDef.20chains.html#168418980">(Jun 18 2019 at 16:44)</a>:</h4>
<p>or something more powerful, I forget</p>



<a name="168419012"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dataflow-based%20UseDef%20chains/near/168419012" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dataflow-based.20UseDef.20chains.html#168419012">(Jun 18 2019 at 16:45)</a>:</h4>
<p><span class="user-mention" data-user-id="118594">@Dylan MacKenzie</span> you don't need it for const-qualif though?</p>



<a name="168419214"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dataflow-based%20UseDef%20chains/near/168419214" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Dylan MacKenzie (ecstatic-morse) <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dataflow-based.20UseDef.20chains.html#168419214">(Jun 18 2019 at 16:47)</a>:</h4>
<p>No, I'm trying to overload <code>rustc_peek</code> to spit out the set of reaching defs for debugging. AFAICT it's doing its own version of <code>state_for_location</code>, but only looking at assignments since that's the only place that will change the initialization state of a move path.</p>



<a name="168419955"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dataflow-based%20UseDef%20chains/near/168419955" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Zoxc <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dataflow-based.20UseDef.20chains.html#168419955">(Jun 18 2019 at 16:55)</a>:</h4>
<p>Not all fields of <code>BlockSets</code> is used in <code>state_for_location</code>, I think. Also you shouldn't be using <code>state_for_location</code>if you're looking at many or all locations.</p>



<a name="168421470"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dataflow-based%20UseDef%20chains/near/168421470" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Dylan MacKenzie (ecstatic-morse) <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dataflow-based.20UseDef.20chains.html#168421470">(Jun 18 2019 at 17:13)</a>:</h4>
<p>@Zoxc, I'm not sure I quite understand your first point. I think someone is working on a cursor to remove the O(n^2) behavior, but that isn't an issue here since <code>rustc_peek</code> is only needs the state at the end of a block.</p>



<a name="168509851"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dataflow-based%20UseDef%20chains/near/168509851" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dataflow-based.20UseDef.20chains.html#168509851">(Jun 19 2019 at 14:09)</a>:</h4>
<p>My current inference is that the pattern in question originated here: <a href="https://github.com/rust-lang/rust/commit/efc7d46188c6696ae873b2b71ead7e34fc4501ab#diff-e1d33bfc0f6996e6a7d96525162675e4R362" target="_blank" title="https://github.com/rust-lang/rust/commit/efc7d46188c6696ae873b2b71ead7e34fc4501ab#diff-e1d33bfc0f6996e6a7d96525162675e4R362">PR 44480, fn state_for_location</a></p>



<a name="168509920"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dataflow-based%20UseDef%20chains/near/168509920" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dataflow-based.20UseDef.20chains.html#168509920">(Jun 19 2019 at 14:09)</a>:</h4>
<p>Note that in particular, that code is creating the <code>IdxSetBuf</code> (<code>entry</code>), and passing a mutable reference to it via the <code>gen_set</code> field.</p>



<a name="168509989"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dataflow-based%20UseDef%20chains/near/168509989" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dataflow-based.20UseDef.20chains.html#168509989">(Jun 19 2019 at 14:10)</a>:</h4>
<p>it also clones it for the <code>on_entry</code> and <code>kill_set</code> fields, but those clones are discarded by this code.</p>



<a name="168510061"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dataflow-based%20UseDef%20chains/near/168510061" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dataflow-based.20UseDef.20chains.html#168510061">(Jun 19 2019 at 14:11)</a>:</h4>
<p>the one that is returned is the one referenced by the <code>gen_set</code> field, because that presumably reflects the accumulated intra-basicblock dataflow state up to and including <code>loc</code></p>



<a name="168510230"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dataflow-based%20UseDef%20chains/near/168510230" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dataflow-based.20UseDef.20chains.html#168510230">(Jun 19 2019 at 14:12)</a>:</h4>
<p>In other words, I <em>think</em> the point is this: We want to compute the intra-block gen-set. We do it by starting with the state at the start of the control flow of the block, and then compute the effect of each statement (as is reflected in the <em>gen-set</em> state that is imperatively modified by <code>statement_effect</code></p>



<a name="168510305"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dataflow-based%20UseDef%20chains/near/168510305" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dataflow-based.20UseDef.20chains.html#168510305">(Jun 19 2019 at 14:13)</a>:</h4>
<p>The fact that we are also creating valid <code>&amp;mut IdxSetBuf</code> values for <code>on_entry</code> and <code>kill_set</code> is, I assume, to allow <code>statement_effect</code> to maintain or reference state within those bits.</p>



<a name="168510427"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dataflow-based%20UseDef%20chains/near/168510427" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dataflow-based.20UseDef.20chains.html#168510427">(Jun 19 2019 at 14:14)</a>:</h4>
<p><span class="user-mention" data-user-id="116466">@Zoxc</span> does the above summary (of how <code>fn state_for_location</code> works) sound approximately correct to you?</p>



<a name="168510729"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dataflow-based%20UseDef%20chains/near/168510729" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dataflow-based.20UseDef.20chains.html#168510729">(Jun 19 2019 at 14:18)</a>:</h4>
<p>(Now, if you ask me, it probably doesn't make sense for the <code>statement_effect</code> method to actually read the current value of the <code>gen_set</code>/<code>kill_set</code> it receives. If my memory is right, it generally just writes to those arrays. And that may be why it does not matter that we are passing in a clone of <code>entry_set</code> as a value for <code>kill_set</code> here; because, I think, no implementation of <code>statement_effect</code> would read those bits anyway.)</p>



<a name="168516225"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dataflow-based%20UseDef%20chains/near/168516225" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Zoxc <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dataflow-based.20UseDef.20chains.html#168516225">(Jun 19 2019 at 15:18)</a>:</h4>
<p>Sounds approximately correct to me =P</p>



<a name="168524765"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dataflow-based%20UseDef%20chains/near/168524765" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Dylan MacKenzie (ecstatic-morse) <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dataflow-based.20UseDef.20chains.html#168524765">(Jun 19 2019 at 17:03)</a>:</h4>
<p>So does <code>state_at_location</code> just ignore kills?</p>



<a name="168580697"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dataflow-based%20UseDef%20chains/near/168580697" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dataflow-based.20UseDef.20chains.html#168580697">(Jun 20 2019 at 09:38)</a>:</h4>
<p><span class="user-mention" data-user-id="118594">@Dylan MacKenzie</span> well, I suspect it doesn't <em>ignore</em> all kills. In particular, since its computing the cumulative effect of some prefix of the block (starting from the entry set state of that block), it needs to apply the kills for each statement to the state</p>



<a name="168580730"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dataflow-based%20UseDef%20chains/near/168580730" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dataflow-based.20UseDef.20chains.html#168580730">(Jun 20 2019 at 09:39)</a>:</h4>
<p>which is fine; I believe that is indeed part of what happens during the loop</p>



<a name="168580744"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dataflow-based%20UseDef%20chains/near/168580744" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dataflow-based.20UseDef.20chains.html#168580744">(Jun 20 2019 at 09:39)</a>:</h4>
<p>what it <em>does</em> ignore is the final value of the cloned <code>kill-set</code>. It throws that away.</p>



<a name="168580765"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dataflow-based%20UseDef%20chains/near/168580765" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dataflow-based.20UseDef.20chains.html#168580765">(Jun 20 2019 at 09:39)</a>:</h4>
<p>and I believe that any state written to that cloned kill-set does not matter.</p>



<a name="168605910"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dataflow-based%20UseDef%20chains/near/168605910" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Dylan MacKenzie (ecstatic-morse) <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dataflow-based.20UseDef.20chains.html#168605910">(Jun 20 2019 at 15:28)</a>:</h4>
<p>I figured out why this works, but it's kind of subtle.</p>



<a name="168605919"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dataflow-based%20UseDef%20chains/near/168605919" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Dylan MacKenzie (ecstatic-morse) <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dataflow-based.20UseDef.20chains.html#168605919">(Jun 20 2019 at 15:28)</a>:</h4>
<div class="codehilite"><pre><span></span><span class="k">pub</span><span class="w"> </span><span class="k">fn</span> <span class="nf">state_for_location</span><span class="o">&lt;</span><span class="na">&#39;tcx</span><span class="p">,</span><span class="w"> </span><span class="n">T</span>: <span class="nc">BitDenotation</span><span class="o">&lt;</span><span class="na">&#39;tcx</span><span class="o">&gt;&gt;</span><span class="p">(</span><span class="n">loc</span>: <span class="nc">Location</span><span class="p">,</span><span class="w"></span>
<span class="w">                                                        </span><span class="n">analysis</span>: <span class="kp">&amp;</span><span class="nc">T</span><span class="p">,</span><span class="w"></span>
<span class="w">                                                        </span><span class="n">result</span>: <span class="kp">&amp;</span><span class="nc">DataflowResults</span><span class="o">&lt;</span><span class="na">&#39;tcx</span><span class="p">,</span><span class="w"> </span><span class="n">T</span><span class="o">&gt;</span><span class="p">,</span><span class="w"></span>
<span class="w">                                                        </span><span class="n">body</span>: <span class="kp">&amp;</span><span class="nc">Body</span><span class="o">&lt;</span><span class="na">&#39;tcx</span><span class="o">&gt;</span><span class="p">)</span><span class="w"></span>
<span class="w">    </span>-&gt; <span class="nc">BitSet</span><span class="o">&lt;</span><span class="n">T</span>::<span class="n">Idx</span><span class="o">&gt;</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">    </span><span class="kd">let</span><span class="w"> </span><span class="k">mut</span><span class="w"> </span><span class="n">on_entry</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">result</span><span class="p">.</span><span class="n">sets</span><span class="p">().</span><span class="n">on_entry_set_for</span><span class="p">(</span><span class="n">loc</span><span class="p">.</span><span class="n">block</span><span class="p">.</span><span class="n">index</span><span class="p">()).</span><span class="n">to_owned</span><span class="p">();</span><span class="w"></span>
<span class="w">    </span><span class="kd">let</span><span class="w"> </span><span class="k">mut</span><span class="w"> </span><span class="n">kill_set</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">on_entry</span><span class="p">.</span><span class="n">to_hybrid</span><span class="p">();</span><span class="w"></span>
<span class="w">    </span><span class="kd">let</span><span class="w"> </span><span class="k">mut</span><span class="w"> </span><span class="n">gen_set</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">kill_set</span><span class="p">.</span><span class="n">clone</span><span class="p">();</span><span class="w"></span>

<span class="w">    </span><span class="p">{</span><span class="w"></span>
<span class="w">        </span><span class="kd">let</span><span class="w"> </span><span class="k">mut</span><span class="w"> </span><span class="n">sets</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">BlockSets</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">            </span><span class="n">on_entry</span>: <span class="kp">&amp;</span><span class="nc">mut</span><span class="w"> </span><span class="n">on_entry</span><span class="p">,</span><span class="w"></span>
<span class="w">            </span><span class="n">kill_set</span>: <span class="kp">&amp;</span><span class="nc">mut</span><span class="w"> </span><span class="n">kill_set</span><span class="p">,</span><span class="w"></span>
<span class="w">            </span><span class="n">gen_set</span>: <span class="kp">&amp;</span><span class="nc">mut</span><span class="w"> </span><span class="n">gen_set</span><span class="p">,</span><span class="w"></span>
<span class="w">        </span><span class="p">};</span><span class="w"></span>

<span class="w">        </span><span class="k">for</span><span class="w"> </span><span class="n">stmt</span><span class="w"> </span><span class="k">in</span><span class="w"> </span><span class="mi">0</span><span class="p">..</span><span class="n">loc</span><span class="p">.</span><span class="n">statement_index</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">            </span><span class="kd">let</span><span class="w"> </span><span class="k">mut</span><span class="w"> </span><span class="n">stmt_loc</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">loc</span><span class="p">;</span><span class="w"></span>
<span class="w">            </span><span class="n">stmt_loc</span><span class="p">.</span><span class="n">statement_index</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">stmt</span><span class="p">;</span><span class="w"></span>
<span class="w">            </span><span class="n">analysis</span><span class="p">.</span><span class="n">before_statement_effect</span><span class="p">(</span><span class="o">&amp;</span><span class="k">mut</span><span class="w"> </span><span class="n">sets</span><span class="p">,</span><span class="w"> </span><span class="n">stmt_loc</span><span class="p">);</span><span class="w"></span>
<span class="w">            </span><span class="n">analysis</span><span class="p">.</span><span class="n">statement_effect</span><span class="p">(</span><span class="o">&amp;</span><span class="k">mut</span><span class="w"> </span><span class="n">sets</span><span class="p">,</span><span class="w"> </span><span class="n">stmt_loc</span><span class="p">);</span><span class="w"></span>
<span class="w">        </span><span class="p">}</span><span class="w"></span>

<span class="w">        </span><span class="c1">// Apply the pre-statement effect of the statement we&#39;re evaluating.</span>
<span class="w">        </span><span class="k">if</span><span class="w"> </span><span class="n">loc</span><span class="p">.</span><span class="n">statement_index</span><span class="w"> </span><span class="o">==</span><span class="w"> </span><span class="n">body</span><span class="p">[</span><span class="n">loc</span><span class="p">.</span><span class="n">block</span><span class="p">].</span><span class="n">statements</span><span class="p">.</span><span class="n">len</span><span class="p">()</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">            </span><span class="n">analysis</span><span class="p">.</span><span class="n">before_terminator_effect</span><span class="p">(</span><span class="o">&amp;</span><span class="k">mut</span><span class="w"> </span><span class="n">sets</span><span class="p">,</span><span class="w"> </span><span class="n">loc</span><span class="p">);</span><span class="w"></span>
<span class="w">        </span><span class="p">}</span><span class="w"> </span><span class="k">else</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">            </span><span class="n">analysis</span><span class="p">.</span><span class="n">before_statement_effect</span><span class="p">(</span><span class="o">&amp;</span><span class="k">mut</span><span class="w"> </span><span class="n">sets</span><span class="p">,</span><span class="w"> </span><span class="n">loc</span><span class="p">);</span><span class="w"></span>
<span class="w">        </span><span class="p">}</span><span class="w"></span>
<span class="w">    </span><span class="p">}</span><span class="w"></span>

<span class="w">    </span><span class="n">gen_set</span><span class="p">.</span><span class="n">to_dense</span><span class="p">()</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>
</pre></div>



<a name="168606060"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dataflow-based%20UseDef%20chains/near/168606060" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Dylan MacKenzie (ecstatic-morse) <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dataflow-based.20UseDef.20chains.html#168606060">(Jun 20 2019 at 15:30)</a>:</h4>
<p>It's because the <code>kill</code> and <code>kill_all</code> setters for <code>BlockSets</code> remove bits from <code>gen_set</code> that conflict with the newly added kills.</p>



<a name="168606696"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dataflow-based%20UseDef%20chains/near/168606696" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Dylan MacKenzie (ecstatic-morse) <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dataflow-based.20UseDef.20chains.html#168606696">(Jun 20 2019 at 15:36)</a>:</h4>
<p>I'd like for someone (possibly me) to replace this API with a cursor which caches the result of the last call of <code>state_for_location</code>. This way accessing statements sequentially won't be <code>O(n^2)</code> (as mentioned above).</p>



<a name="168606927"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dataflow-based%20UseDef%20chains/near/168606927" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Dylan MacKenzie (ecstatic-morse) <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dataflow-based.20UseDef.20chains.html#168606927">(Jun 20 2019 at 15:39)</a>:</h4>
<p>Hence all the questions :)</p>



<a name="168624277"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dataflow-based%20UseDef%20chains/near/168624277" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dataflow-based.20UseDef.20chains.html#168624277">(Jun 20 2019 at 19:01)</a>:</h4>
<p>right: computing the cumulative <code>gen-set</code> for the whole block requires combining both the gens <em>and the kills</em> of the statements in the block.</p>



<a name="168624305"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dataflow-based%20UseDef%20chains/near/168624305" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dataflow-based.20UseDef.20chains.html#168624305">(Jun 20 2019 at 19:01)</a>:</h4>
<p>(a critical detail I left out above)</p>



<a name="168627461"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dataflow-based%20UseDef%20chains/near/168627461" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Dylan MacKenzie (ecstatic-morse) <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dataflow-based.20UseDef.20chains.html#168627461">(Jun 20 2019 at 19:38)</a>:</h4>
<p>There's <del>a couple more issues</del> another issue I have with the implementation.</p>
<p><del>First, should <code>state_for_location</code> include <code>before_statement_effect</code> for the given location? Currently it does not.</del> Ignore this, I was wrong :)</p>



<a name="168627747"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dataflow-based%20UseDef%20chains/near/168627747" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Dylan MacKenzie (ecstatic-morse) <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dataflow-based.20UseDef.20chains.html#168627747">(Jun 20 2019 at 19:41)</a>:</h4>
<p>Second, when we're building the transfer function by visiting each statement, <code>on_entry</code> is empty (or full if <code>bottom_value == true</code>) at the start of every basic block except <code>START_BLOCK</code> (which has <code>start_block_effect</code> applied to it). If <code>accumulates_intrablock_state</code> is <code>true</code>, each statement gets to observe the effect of all previous statements before it in the same block on the initial <code>on_entry</code> when deciding its transfer function.</p>



<a name="168627825"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dataflow-based%20UseDef%20chains/near/168627825" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Dylan MacKenzie (ecstatic-morse) <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dataflow-based.20UseDef.20chains.html#168627825">(Jun 20 2019 at 19:42)</a>:</h4>
<p>However, in <code>state_for_location</code>, <code>on_entry</code> is initialized to the fixpoint instead.</p>



<a name="168627830"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dataflow-based%20UseDef%20chains/near/168627830" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Dylan MacKenzie (ecstatic-morse) <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dataflow-based.20UseDef.20chains.html#168627830">(Jun 20 2019 at 19:42)</a>:</h4>
<p><span class="user-mention" data-user-id="116083">@pnkfelix</span></p>



<a name="168628016"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dataflow-based%20UseDef%20chains/near/168628016" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Dylan MacKenzie (ecstatic-morse) <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dataflow-based.20UseDef.20chains.html#168628016">(Jun 20 2019 at 19:44)</a>:</h4>
<p>(assuming dataflow analysis is run before <code>state_for_location</code> is called</p>



<a name="168628336"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dataflow-based%20UseDef%20chains/near/168628336" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Dylan MacKenzie (ecstatic-morse) <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dataflow-based.20UseDef.20chains.html#168628336">(Jun 20 2019 at 19:48)</a>:</h4>
<p>I need modify this to support arbitrary transfer functions as described here: <a href="#narrow/stream/146212-t-compiler.2Fconst-eval/topic/dataflow-based.20const.20qualification.20MVP/near/168608696" title="#narrow/stream/146212-t-compiler.2Fconst-eval/topic/dataflow-based.20const.20qualification.20MVP/near/168608696">https://rust-lang.zulipchat.com/#narrow/stream/146212-t-compiler.2Fconst-eval/topic/dataflow-based.20const.20qualification.20MVP/near/168608696</a></p>



<a name="168628422"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dataflow-based%20UseDef%20chains/near/168628422" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Dylan MacKenzie (ecstatic-morse) <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dataflow-based.20UseDef.20chains.html#168628422">(Jun 20 2019 at 19:49)</a>:</h4>
<p>Whether or not this is a good idea is TBD :)</p>



<a name="168629752"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dataflow-based%20UseDef%20chains/near/168629752" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dataflow-based.20UseDef.20chains.html#168629752">(Jun 20 2019 at 20:03)</a>:</h4>
<p>What was the question?</p>



<a name="168629783"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dataflow-based%20UseDef%20chains/near/168629783" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dataflow-based.20UseDef.20chains.html#168629783">(Jun 20 2019 at 20:03)</a>:</h4>
<p>in the first case, we are computing the transfer function for the whole block, before we know what the fixed point is</p>



<a name="168629863"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dataflow-based%20UseDef%20chains/near/168629863" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dataflow-based.20UseDef.20chains.html#168629863">(Jun 20 2019 at 20:04)</a>:</h4>
<p>in the second case, we are taking the fixed point result (which is only saved at the entry point for each block), and using it to compute the precise state within a block</p>



<a name="168629952"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dataflow-based%20UseDef%20chains/near/168629952" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Dylan MacKenzie (ecstatic-morse) <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dataflow-based.20UseDef.20chains.html#168629952">(Jun 20 2019 at 20:05)</a>:</h4>
<p>To do that, we have to recompute the transfer function for each statement, but we're passing different inputs to the function which determines the transfer function in <code>state_for_location</code> than we are when we initially run dataflow.</p>



<a name="168630024"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dataflow-based%20UseDef%20chains/near/168630024" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Dylan MacKenzie (ecstatic-morse) <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dataflow-based.20UseDef.20chains.html#168630024">(Jun 20 2019 at 20:06)</a>:</h4>
<p><span class="user-mention" data-user-id="116083">@pnkfelix</span>  which I think is incorrect</p>



<a name="168630045"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dataflow-based%20UseDef%20chains/near/168630045" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dataflow-based.20UseDef.20chains.html#168630045">(Jun 20 2019 at 20:06)</a>:</h4>
<p>yeah so that probably prvides evidence that <code>statement_effect</code>should not be reading from the state of <code>on_entry</code> in its calculation, right?</p>



<a name="168630088"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dataflow-based%20UseDef%20chains/near/168630088" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Dylan MacKenzie (ecstatic-morse) <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dataflow-based.20UseDef.20chains.html#168630088">(Jun 20 2019 at 20:08)</a>:</h4>
<p>When I did the refactor in <a href="https://github.com/rust-lang/rust/issues/61787" target="_blank" title="https://github.com/rust-lang/rust/issues/61787">#61787</a>, I initially removed that parameter since I couldn't see when you would want to read from <code>on_entry</code></p>



<a name="168630137"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dataflow-based%20UseDef%20chains/near/168630137" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dataflow-based.20UseDef.20chains.html#168630137">(Jun 20 2019 at 20:08)</a>:</h4>
<p>someone does want to read from it?</p>



<a name="168630149"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dataflow-based%20UseDef%20chains/near/168630149" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Dylan MacKenzie (ecstatic-morse) <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dataflow-based.20UseDef.20chains.html#168630149">(Jun 20 2019 at 20:08)</a>:</h4>
<p>but it's currently used  in...</p>



<a name="168630227"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dataflow-based%20UseDef%20chains/near/168630227" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dataflow-based.20UseDef.20chains.html#168630227">(Jun 20 2019 at 20:09)</a>:</h4>
<p>oh maybe its used for something in functions that use <code>accumulates_intrablock_state</code>, let me look</p>



<a name="168630236"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dataflow-based%20UseDef%20chains/near/168630236" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Dylan MacKenzie (ecstatic-morse) <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dataflow-based.20UseDef.20chains.html#168630236">(Jun 20 2019 at 20:09)</a>:</h4>
<p><a href="https://github.com/rust-lang/rust/blob/f0c2bdf52e0c8bce258f1bbb5652c9691b7f3193/src/librustc_mir/dataflow/impls/borrows.rs#L207" target="_blank" title="https://github.com/rust-lang/rust/blob/f0c2bdf52e0c8bce258f1bbb5652c9691b7f3193/src/librustc_mir/dataflow/impls/borrows.rs#L207">https://github.com/rust-lang/rust/blob/f0c2bdf52e0c8bce258f1bbb5652c9691b7f3193/src/librustc_mir/dataflow/impls/borrows.rs#L207</a></p>



<a name="168630247"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dataflow-based%20UseDef%20chains/near/168630247" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Dylan MacKenzie (ecstatic-morse) <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dataflow-based.20UseDef.20chains.html#168630247">(Jun 20 2019 at 20:10)</a>:</h4>
<p>this function</p>



<a name="168630317"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dataflow-based%20UseDef%20chains/near/168630317" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dataflow-based.20UseDef.20chains.html#168630317">(Jun 20 2019 at 20:10)</a>:</h4>
<p>hmm</p>



<a name="168630346"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dataflow-based%20UseDef%20chains/near/168630346" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dataflow-based.20UseDef.20chains.html#168630346">(Jun 20 2019 at 20:11)</a>:</h4>
<p>seems dangerous</p>



<a name="168630468"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dataflow-based%20UseDef%20chains/near/168630468" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Dylan MacKenzie (ecstatic-morse) <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dataflow-based.20UseDef.20chains.html#168630468">(Jun 20 2019 at 20:12)</a>:</h4>
<p>Updating <code>on_entry</code> when defining the transfer function is the only reason <code>accumulates_intrablock_state</code> exists right?</p>



<a name="168630497"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dataflow-based%20UseDef%20chains/near/168630497" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dataflow-based.20UseDef.20chains.html#168630497">(Jun 20 2019 at 20:13)</a>:</h4>
<p>that was what I was initially thinking, but I think you found a counter example</p>



<a name="168630573"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dataflow-based%20UseDef%20chains/near/168630573" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dataflow-based.20UseDef.20chains.html#168630573">(Jun 20 2019 at 20:14)</a>:</h4>
<p>my current guess is that kill_borrows_on_place is reading from <code>on_entry</code>  only as a way to avoid iterating over the whole universe</p>



<a name="168630624"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dataflow-based%20UseDef%20chains/near/168630624" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dataflow-based.20UseDef.20chains.html#168630624">(Jun 20 2019 at 20:15)</a>:</h4>
<p>in terms of what is "correct" for the API as designed, especially given that we start with empty-sets for <code>on_entry</code>, I would have thought you need to compute the kill-sets there more conservatively</p>



<a name="168630633"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dataflow-based%20UseDef%20chains/near/168630633" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dataflow-based.20UseDef.20chains.html#168630633">(Jun 20 2019 at 20:15)</a>:</h4>
<p>cc <span class="user-mention" data-user-id="116107">@davidtwco</span> ^</p>



<a name="168630755"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dataflow-based%20UseDef%20chains/near/168630755" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Dylan MacKenzie (ecstatic-morse) <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dataflow-based.20UseDef.20chains.html#168630755">(Jun 20 2019 at 20:17)</a>:</h4>
<p>So right now this "kill"s all borrows that <em>occurred earlier in the same basic block</em> that <strong>definitely</strong> conflict with the borrow at the current statment.</p>



<a name="168630830"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dataflow-based%20UseDef%20chains/near/168630830" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dataflow-based.20UseDef.20chains.html#168630830">(Jun 20 2019 at 20:18)</a>:</h4>
<p>right, and that doesn't sound sufficient to me</p>



<a name="168630860"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dataflow-based%20UseDef%20chains/near/168630860" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dataflow-based.20UseDef.20chains.html#168630860">(Jun 20 2019 at 20:18)</a>:</h4>
<p>I last looked at this part of the compiler quite a while ago so I’ll need to bring it back into cache to be useful here.</p>



<a name="168631112"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dataflow-based%20UseDef%20chains/near/168631112" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dataflow-based.20UseDef.20chains.html#168631112">(Jun 20 2019 at 20:22)</a>:</h4>
<p>(yeah its been a while for me too)</p>



<a name="168631191"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dataflow-based%20UseDef%20chains/near/168631191" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dataflow-based.20UseDef.20chains.html#168631191">(Jun 20 2019 at 20:23)</a>:</h4>
<p>one reason why we may not be hitting bugs here as often as you might expect is because we only go into this path for non-<code>Local</code> places.</p>



<a name="168631267"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dataflow-based%20UseDef%20chains/near/168631267" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Dylan MacKenzie (ecstatic-morse) <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dataflow-based.20UseDef.20chains.html#168631267">(Jun 20 2019 at 20:24)</a>:</h4>
<p>The issue you're discussing is specific to the borrow check analysis though? It's sometimes valid to look at the accumulated state within a block?</p>



<a name="168631328"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dataflow-based%20UseDef%20chains/near/168631328" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Dylan MacKenzie (ecstatic-morse) <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dataflow-based.20UseDef.20chains.html#168631328">(Jun 20 2019 at 20:25)</a>:</h4>
<p>And can starting with the fixpoint instead of the empty set (or <code>start_block_effect</code>) in <code>state_for_location</code>  cause errors?</p>



<a name="168631404"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dataflow-based%20UseDef%20chains/near/168631404" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dataflow-based.20UseDef.20chains.html#168631404">(Jun 20 2019 at 20:26)</a>:</h4>
<p>oh sure: what I'm currently saying is that I'm worried that kill_borrows_on_place is buggy.</p>



<a name="168631450"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dataflow-based%20UseDef%20chains/near/168631450" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dataflow-based.20UseDef.20chains.html#168631450">(Jun 20 2019 at 20:27)</a>:</h4>
<p>In general ... I would need to review the other cases that read from <code>on_entry</code></p>



<a name="168631479"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dataflow-based%20UseDef%20chains/near/168631479" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Dylan MacKenzie (ecstatic-morse) <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dataflow-based.20UseDef.20chains.html#168631479">(Jun 20 2019 at 20:27)</a>:</h4>
<p>You've just reviewed all of them :)</p>



<a name="168631481"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dataflow-based%20UseDef%20chains/near/168631481" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dataflow-based.20UseDef.20chains.html#168631481">(Jun 20 2019 at 20:27)</a>:</h4>
<p>namely the ones that motivated the addition of <code>fn accumulates_intrablock_state</code></p>



<a name="168631488"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dataflow-based%20UseDef%20chains/near/168631488" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Dylan MacKenzie (ecstatic-morse) <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dataflow-based.20UseDef.20chains.html#168631488">(Jun 20 2019 at 20:27)</a>:</h4>
<p>AFAICT</p>



<a name="168631573"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dataflow-based%20UseDef%20chains/near/168631573" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dataflow-based.20UseDef.20chains.html#168631573">(Jun 20 2019 at 20:28)</a>:</h4>
<p>wait, so does <em>no one</em> override <code>fn accumulates_intrablock_state</code> anymore?</p>



<a name="168631658"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dataflow-based%20UseDef%20chains/near/168631658" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dataflow-based.20UseDef.20chains.html#168631658">(Jun 20 2019 at 20:29)</a>:</h4>
<blockquote>
<p>And can starting with the fixpoint instead of the empty set (or <code>start_block_effect</code>) in <code>state_for_location</code>  cause errors?</p>
</blockquote>
<p>I do not believe this would cause errors. In fact, I think starting with the fixed point is <em>necessary</em> for the correctness of <code>state_for_location</code></p>



<a name="168631788"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dataflow-based%20UseDef%20chains/near/168631788" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Dylan MacKenzie (ecstatic-morse) <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dataflow-based.20UseDef.20chains.html#168631788">(Jun 20 2019 at 20:30)</a>:</h4>
<p>I see no one overriding <code>accumulates_intrablock_state</code> (including <code>Borrows</code>, which means the entry set is always empty except in the start block)</p>



<a name="168631940"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dataflow-based%20UseDef%20chains/near/168631940" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Dylan MacKenzie (ecstatic-morse) <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dataflow-based.20UseDef.20chains.html#168631940">(Jun 20 2019 at 20:33)</a>:</h4>
<p>I'll try to rephrase, I think a proper implementation of <code>state_for_location</code> should:<br>
1. Initialize a <code>BitSet</code> to the fixpoint at entry to the basic block.<br>
2. Pass an <strong>empty</strong> bitset to <code>{statement,terminator}_effect</code> (if <code>accumulates_intrablock_state</code> is <code>false</code>) to get the transfer function.<br>
3. Apply the transfer function to the fixpoint</p>



<a name="168631999"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dataflow-based%20UseDef%20chains/near/168631999" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dataflow-based.20UseDef.20chains.html#168631999">(Jun 20 2019 at 20:34)</a>:</h4>
<p>that sounds like that would be correct</p>



<a name="168632053"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dataflow-based%20UseDef%20chains/near/168632053" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dataflow-based.20UseDef.20chains.html#168632053">(Jun 20 2019 at 20:34)</a>:</h4>
<p>but I think the end effect would be the same as what it does now?</p>



<a name="168632094"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dataflow-based%20UseDef%20chains/near/168632094" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Dylan MacKenzie (ecstatic-morse) <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dataflow-based.20UseDef.20chains.html#168632094">(Jun 20 2019 at 20:34)</a>:</h4>
<p>Currently step 2 is pass the fixpoint to <code>{statement,terminator}_effect</code> to get the transfer function</p>



<a name="168632145"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dataflow-based%20UseDef%20chains/near/168632145" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dataflow-based.20UseDef.20chains.html#168632145">(Jun 20 2019 at 20:35)</a>:</h4>
<p>Well, it would be the same, depending on whether <code>{statement, terminator}_effect</code> are allowed to change their behavior based on <em>reading from</em> <code>gen-set</code> or <code>kill-set</code>.</p>



<a name="168632220"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dataflow-based%20UseDef%20chains/near/168632220" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dataflow-based.20UseDef.20chains.html#168632220">(Jun 20 2019 at 20:36)</a>:</h4>
<p>(i've been assuming they are not allowed to read; only write. And thus, the current implementation uses the fixed-point-computed <code>on_entry</code>, and passes that in as the initial value for <code>gen-set</code>. Then applying the effect of each statement updates <code>gen-set</code> accordingly.)</p>



<a name="168632315"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dataflow-based%20UseDef%20chains/near/168632315" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Dylan MacKenzie (ecstatic-morse) <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dataflow-based.20UseDef.20chains.html#168632315">(Jun 20 2019 at 20:37)</a>:</h4>
<p>So the fixpoint is passed to <code>on_entry</code> as well in <code>state_for_location</code>, meaning that reading from <code>on_entry</code> (as is done in <code>Borrows</code>) may also cause a different transfer function to be generated depending on whether we're actually running dataflow or doing <code>state_for_location</code></p>



<a name="168632318"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dataflow-based%20UseDef%20chains/near/168632318" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dataflow-based.20UseDef.20chains.html#168632318">(Jun 20 2019 at 20:37)</a>:</h4>
<p>But the implementation you describe sounds like it could be more robust, in terms of not having to follow rules like "don't ever read from <code>gen-sets</code>/`kill-sets</p>



<a name="168632417"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dataflow-based%20UseDef%20chains/near/168632417" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dataflow-based.20UseDef.20chains.html#168632417">(Jun 20 2019 at 20:38)</a>:</h4>
<p>yeah I think the problem here is that I don't think of the <code>gen-set</code> being computed by <code>state_for_location</code> as being the transfer function. It is the <em>result of applying</em> the transfer function to the entry set</p>



<a name="168632444"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dataflow-based%20UseDef%20chains/near/168632444" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dataflow-based.20UseDef.20chains.html#168632444">(Jun 20 2019 at 20:39)</a>:</h4>
<p>or, yes, sorry</p>



<a name="168632453"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dataflow-based%20UseDef%20chains/near/168632453" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dataflow-based.20UseDef.20chains.html#168632453">(Jun 20 2019 at 20:39)</a>:</h4>
<p>I misread your message</p>



<a name="168632468"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dataflow-based%20UseDef%20chains/near/168632468" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Dylan MacKenzie (ecstatic-morse) <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dataflow-based.20UseDef.20chains.html#168632468">(Jun 20 2019 at 20:39)</a>:</h4>
<p>I agree, but the question is how do you get the transfer function.</p>



<a name="168632489"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dataflow-based%20UseDef%20chains/near/168632489" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dataflow-based.20UseDef.20chains.html#168632489">(Jun 20 2019 at 20:39)</a>:</h4>
<p>reading from <code>on_entry</code>, as is done in <code>Borrows</code>, does seem like it could cause a different transfer function to be computed in the two cases</p>



<a name="168632501"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dataflow-based%20UseDef%20chains/near/168632501" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dataflow-based.20UseDef.20chains.html#168632501">(Jun 20 2019 at 20:39)</a>:</h4>
<p>which is exactly what I'm sitting here worried about</p>



<a name="168632572"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dataflow-based%20UseDef%20chains/near/168632572" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dataflow-based.20UseDef.20chains.html#168632572">(Jun 20 2019 at 20:40)</a>:</h4>
<p>especially since the transfer function you get from <code>on_entry</code>=null-set seems like it might miss important entries in the kill-set.</p>



<a name="168632686"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dataflow-based%20UseDef%20chains/near/168632686" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Dylan MacKenzie (ecstatic-morse) <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dataflow-based.20UseDef.20chains.html#168632686">(Jun 20 2019 at 20:41)</a>:</h4>
<p>It seems wrong to me too (especially since <code>accumulate_intrablock_state</code> is <code>false</code>), but I'd have to read more to understand the original intent.</p>



<a name="168632806"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dataflow-based%20UseDef%20chains/near/168632806" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dataflow-based.20UseDef.20chains.html#168632806">(Jun 20 2019 at 20:43)</a>:</h4>
<p>oh I now see who was using <code>accumulate_intrablock_state</code></p>



<a name="168632807"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dataflow-based%20UseDef%20chains/near/168632807" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Dylan MacKenzie (ecstatic-morse) <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dataflow-based.20UseDef.20chains.html#168632807">(Jun 20 2019 at 20:43)</a>:</h4>
<p>Can I go to a PR from a commit hash?</p>



<a name="168632822"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dataflow-based%20UseDef%20chains/near/168632822" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dataflow-based.20UseDef.20chains.html#168632822">(Jun 20 2019 at 20:43)</a>:</h4>
<p>it originated from <a href="https://github.com/rust-lang/rust/issues/46537" target="_blank" title="https://github.com/rust-lang/rust/issues/46537">#46537</a></p>



<a name="168632841"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dataflow-based%20UseDef%20chains/near/168632841" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dataflow-based.20UseDef.20chains.html#168632841">(Jun 20 2019 at 20:43)</a>:</h4>
<blockquote>
<p>Can I go to a PR from a commit hash?</p>
</blockquote>
<p>I do it via the web interface for github</p>



<a name="168632925"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dataflow-based%20UseDef%20chains/near/168632925" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Dylan MacKenzie (ecstatic-morse) <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dataflow-based.20UseDef.20chains.html#168632925">(Jun 20 2019 at 20:44)</a>:</h4>
<p><a href="https://github.com/rust-lang/rust/commit/db635fc5664c0a19cdb4063545ca2d2b297f0212" target="_blank" title="https://github.com/rust-lang/rust/commit/db635fc5664c0a19cdb4063545ca2d2b297f0212">https://github.com/rust-lang/rust/commit/db635fc5664c0a19cdb4063545ca2d2b297f0212</a></p>



<a name="168632926"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dataflow-based%20UseDef%20chains/near/168632926" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dataflow-based.20UseDef.20chains.html#168632926">(Jun 20 2019 at 20:44)</a>:</h4>
<p>e.g. if you look at <a href="https://github.com/rust-lang/rust/commit/e123117cb7c1b7f8854858721ccbdbca4e918061" target="_blank" title="https://github.com/rust-lang/rust/commit/e123117cb7c1b7f8854858721ccbdbca4e918061">this commit</a>, you'll see it says "master (<a href="https://github.com/rust-lang/rust/issues/46537" target="_blank" title="https://github.com/rust-lang/rust/issues/46537">#46537</a>)" beneath the log message for the commit.</p>



<a name="168632944"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dataflow-based%20UseDef%20chains/near/168632944" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Dylan MacKenzie (ecstatic-morse) <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dataflow-based.20UseDef.20chains.html#168632944">(Jun 20 2019 at 20:44)</a>:</h4>
<p>Ah, got it</p>



<a name="168632982"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dataflow-based%20UseDef%20chains/near/168632982" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dataflow-based.20UseDef.20chains.html#168632982">(Jun 20 2019 at 20:45)</a>:</h4>
<p>okay so first things first</p>



<a name="168632990"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dataflow-based%20UseDef%20chains/near/168632990" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dataflow-based.20UseDef.20chains.html#168632990">(Jun 20 2019 at 20:45)</a>:</h4>
<p>lets kill off <code>accumulates_intrablock_state</code></p>



<a name="168633023"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dataflow-based%20UseDef%20chains/near/168633023" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dataflow-based.20UseDef.20chains.html#168633023">(Jun 20 2019 at 20:45)</a>:</h4>
<p>before anyone else has "really bright ideas" like I did in that old buggy two-phase borrows hack.</p>



<a name="168633154"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dataflow-based%20UseDef%20chains/near/168633154" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dataflow-based.20UseDef.20chains.html#168633154">(Jun 20 2019 at 20:47)</a>:</h4>
<p>but also</p>



<a name="168633177"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dataflow-based%20UseDef%20chains/near/168633177" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Dylan MacKenzie (ecstatic-morse) <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dataflow-based.20UseDef.20chains.html#168633177">(Jun 20 2019 at 20:47)</a>:</h4>
<p>I do have one use case, if we allow transfer functions that copy bits from other locals in the dataflow set (this is one approach to dataflow-based const-qualification, the other is based on reaching definitions). Then we may want to simply gen the qualification bits for <code>_2</code> in code like:</p>
<div class="codehilite"><pre><span></span>_1 = {something qualified}
_2 = _1
</pre></div>



<a name="168633178"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dataflow-based%20UseDef%20chains/near/168633178" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dataflow-based.20UseDef.20chains.html#168633178">(Jun 20 2019 at 20:47)</a>:</h4>
<p>do i dare log an issue saying that I need to investigate whether kill_borrows_on_place is secretly buggy...</p>



<a name="168633232"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dataflow-based%20UseDef%20chains/near/168633232" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Dylan MacKenzie (ecstatic-morse) <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dataflow-based.20UseDef.20chains.html#168633232">(Jun 20 2019 at 20:48)</a>:</h4>
<p>instead of copying the qualifications from <code>_1</code> (which is slow)</p>



<a name="168633266"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dataflow-based%20UseDef%20chains/near/168633266" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Dylan MacKenzie (ecstatic-morse) <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dataflow-based.20UseDef.20chains.html#168633266">(Jun 20 2019 at 20:49)</a>:</h4>
<p>Also, this particular code landed in <a href="https://github.com/rust-lang/rust/issues/56649" target="_blank" title="https://github.com/rust-lang/rust/issues/56649">#56649</a></p>



<a name="168633299"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dataflow-based%20UseDef%20chains/near/168633299" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dataflow-based.20UseDef.20chains.html#168633299">(Jun 20 2019 at 20:49)</a>:</h4>
<p>yeah I was talking about where <code>accumulates_intrablock_state</code> came from</p>



<a name="168633385"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dataflow-based%20UseDef%20chains/near/168633385" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dataflow-based.20UseDef.20chains.html#168633385">(Jun 20 2019 at 20:50)</a>:</h4>
<p>(because no one is currently overriding it, so I wanted to see what my movitation  was for adding it in the first place)</p>



<a name="168633413"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dataflow-based%20UseDef%20chains/near/168633413" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Dylan MacKenzie (ecstatic-morse) <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dataflow-based.20UseDef.20chains.html#168633413">(Jun 20 2019 at 20:50)</a>:</h4>
<p>Ah yes</p>



<a name="168633420"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dataflow-based%20UseDef%20chains/near/168633420" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dataflow-based.20UseDef.20chains.html#168633420">(Jun 20 2019 at 20:50)</a>:</h4>
<p>I agree that <code>kill_borrows_on_place</code> originated with PR <a href="https://github.com/rust-lang/rust/issues/56649" target="_blank" title="https://github.com/rust-lang/rust/issues/56649">#56649</a>; that's why I cc'ed <span class="user-mention" data-user-id="116107">@davidtwco</span> above.</p>



<a name="168633610"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dataflow-based%20UseDef%20chains/near/168633610" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dataflow-based.20UseDef.20chains.html#168633610">(Jun 20 2019 at 20:53)</a>:</h4>
<p>so, like, the motivating example on the description of issue <a href="https://github.com/rust-lang/rust/issues/46589" target="_blank" title="https://github.com/rust-lang/rust/issues/46589">#46589</a> looks like something that is operating on a local</p>



<a name="168633615"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dataflow-based%20UseDef%20chains/near/168633615" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dataflow-based.20UseDef.20chains.html#168633615">(Jun 20 2019 at 20:53)</a>:</h4>
<p>and thus it would not even get into the code here</p>



<a name="168633624"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dataflow-based%20UseDef%20chains/near/168633624" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dataflow-based.20UseDef.20chains.html#168633624">(Jun 20 2019 at 20:53)</a>:</h4>
<p>so the challenge for me is to try to construct an example</p>



<a name="168633628"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dataflow-based%20UseDef%20chains/near/168633628" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dataflow-based.20UseDef.20chains.html#168633628">(Jun 20 2019 at 20:54)</a>:</h4>
<p>where it is not operating on a local</p>



<a name="168633675"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dataflow-based%20UseDef%20chains/near/168633675" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dataflow-based.20UseDef.20chains.html#168633675">(Jun 20 2019 at 20:54)</a>:</h4>
<p>and where the transfer function here</p>



<a name="168633680"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dataflow-based%20UseDef%20chains/near/168633680" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dataflow-based.20UseDef.20chains.html#168633680">(Jun 20 2019 at 20:54)</a>:</h4>
<p>computes an insufficient kill-set</p>



<a name="168633690"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dataflow-based%20UseDef%20chains/near/168633690" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dataflow-based.20UseDef.20chains.html#168633690">(Jun 20 2019 at 20:54)</a>:</h4>
<p>and thus we end up with incorrect results in our final analysis</p>



<a name="168633708"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dataflow-based%20UseDef%20chains/near/168633708" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dataflow-based.20UseDef.20chains.html#168633708">(Jun 20 2019 at 20:54)</a>:</h4>
<p>(but can I accept that challenge at 22:54 at night ...?)</p>



<a name="168633765"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dataflow-based%20UseDef%20chains/near/168633765" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Dylan MacKenzie (ecstatic-morse) <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dataflow-based.20UseDef.20chains.html#168633765">(Jun 20 2019 at 20:55)</a>:</h4>
<p>XD</p>



<a name="168633861"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dataflow-based%20UseDef%20chains/near/168633861" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dataflow-based.20UseDef.20chains.html#168633861">(Jun 20 2019 at 20:57)</a>:</h4>
<p>OR ... oh</p>



<a name="168633877"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dataflow-based%20UseDef%20chains/near/168633877" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dataflow-based.20UseDef.20chains.html#168633877">(Jun 20 2019 at 20:57)</a>:</h4>
<p>does this <em>just</em> cause us to reject code</p>



<a name="168633882"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dataflow-based%20UseDef%20chains/near/168633882" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dataflow-based.20UseDef.20chains.html#168633882">(Jun 20 2019 at 20:57)</a>:</h4>
<p>that we would otherwise accept ...?</p>



<a name="168633884"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dataflow-based%20UseDef%20chains/near/168633884" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dataflow-based.20UseDef.20chains.html#168633884">(Jun 20 2019 at 20:57)</a>:</h4>
<p>/me thinks</p>



<a name="168633893"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dataflow-based%20UseDef%20chains/near/168633893" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dataflow-based.20UseDef.20chains.html#168633893">(Jun 20 2019 at 20:57)</a>:</h4>
<p>that could be a reason why no one has filed a bug about this</p>



<a name="168633896"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dataflow-based%20UseDef%20chains/near/168633896" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Dylan MacKenzie (ecstatic-morse) <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dataflow-based.20UseDef.20chains.html#168633896">(Jun 20 2019 at 20:57)</a>:</h4>
<p>I have about two weeks of experience working with MIR so I'm not gonna be very helpful I'm afraid :</p>



<a name="168633986"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dataflow-based%20UseDef%20chains/near/168633986" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dataflow-based.20UseDef.20chains.html#168633986">(Jun 20 2019 at 20:58)</a>:</h4>
<p>consider this example: <a href="https://play.rust-lang.org/?version=stable&amp;mode=debug&amp;edition=2018&amp;gist=6c1e275769db89f67966969f5bcee308" target="_blank" title="https://play.rust-lang.org/?version=stable&amp;mode=debug&amp;edition=2018&amp;gist=6c1e275769db89f67966969f5bcee308">https://play.rust-lang.org/?version=stable&amp;mode=debug&amp;edition=2018&amp;gist=6c1e275769db89f67966969f5bcee308</a></p>



<a name="168633999"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dataflow-based%20UseDef%20chains/near/168633999" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dataflow-based.20UseDef.20chains.html#168633999">(Jun 20 2019 at 20:58)</a>:</h4>
<p>(at this point I'm just talking out loud)</p>



<a name="168634005"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dataflow-based%20UseDef%20chains/near/168634005" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Dylan MacKenzie (ecstatic-morse) <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dataflow-based.20UseDef.20chains.html#168634005">(Jun 20 2019 at 20:58)</a>:</h4>
<p>but I'm gonna try to understand!</p>



<a name="168634019"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dataflow-based%20UseDef%20chains/near/168634019" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dataflow-based.20UseDef.20chains.html#168634019">(Jun 20 2019 at 20:58)</a>:</h4>
<p>there are two functions there</p>



<a name="168634022"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dataflow-based%20UseDef%20chains/near/168634022" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Dylan MacKenzie (ecstatic-morse) <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dataflow-based.20UseDef.20chains.html#168634022">(Jun 20 2019 at 20:58)</a>:</h4>
<p>Since I'm west coast US, and thus currently of sound mind</p>



<a name="168634030"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dataflow-based%20UseDef%20chains/near/168634030" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dataflow-based.20UseDef.20chains.html#168634030">(Jun 20 2019 at 20:58)</a>:</h4>
<p><code>to_refs1</code> and <code>to_refs2</code></p>



<a name="168634040"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dataflow-based%20UseDef%20chains/near/168634040" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dataflow-based.20UseDef.20chains.html#168634040">(Jun 20 2019 at 20:58)</a>:</h4>
<p>adapted from <a href="https://github.com/rust-lang/rust/issues/46589" target="_blank" title="https://github.com/rust-lang/rust/issues/46589">#46589</a></p>



<a name="168634069"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dataflow-based%20UseDef%20chains/near/168634069" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dataflow-based.20UseDef.20chains.html#168634069">(Jun 20 2019 at 20:59)</a>:</h4>
<p>they are almost identical</p>



<a name="168634079"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dataflow-based%20UseDef%20chains/near/168634079" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dataflow-based.20UseDef.20chains.html#168634079">(Jun 20 2019 at 20:59)</a>:</h4>
<p><code>to_refs2</code> is just wrapping a unary tuple, <code>(T,)</code>, around the given typee</p>



<a name="168634087"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dataflow-based%20UseDef%20chains/near/168634087" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Dylan MacKenzie (ecstatic-morse) <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dataflow-based.20UseDef.20chains.html#168634087">(Jun 20 2019 at 20:59)</a>:</h4>
<p>Except you're borrowing a projection instead of a bare local</p>



<a name="168634092"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dataflow-based%20UseDef%20chains/near/168634092" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dataflow-based.20UseDef.20chains.html#168634092">(Jun 20 2019 at 20:59)</a>:</h4>
<p>that is a hack to force us to go down the non-local path</p>



<a name="168634095"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dataflow-based%20UseDef%20chains/near/168634095" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dataflow-based.20UseDef.20chains.html#168634095">(Jun 20 2019 at 20:59)</a>:</h4>
<p>and the compiler rejects <code>to_refs2</code></p>



<a name="168634194"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dataflow-based%20UseDef%20chains/near/168634194" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dataflow-based.20UseDef.20chains.html#168634194">(Jun 20 2019 at 21:00)</a>:</h4>
<p>because, if we <em>under-estimate</em> the kill-set for <code>borrows</code></p>



<a name="168634217"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dataflow-based%20UseDef%20chains/near/168634217" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dataflow-based.20UseDef.20chains.html#168634217">(Jun 20 2019 at 21:01)</a>:</h4>
<p>then we end up with a <em>over-approximate</em> fixed point, right?</p>



<a name="168634252"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dataflow-based%20UseDef%20chains/near/168634252" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dataflow-based.20UseDef.20chains.html#168634252">(Jun 20 2019 at 21:01)</a>:</h4>
<p>as in, we end up with a fixed point that has more borrows in it than is strictly necessary .... I <em>think</em></p>



<a name="168634261"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dataflow-based%20UseDef%20chains/near/168634261" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dataflow-based.20UseDef.20chains.html#168634261">(Jun 20 2019 at 21:01)</a>:</h4>
<p>but I'll definitely need to think more carefully about that</p>



<a name="168634282"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dataflow-based%20UseDef%20chains/near/168634282" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dataflow-based.20UseDef.20chains.html#168634282">(Jun 20 2019 at 21:01)</a>:</h4>
<p>(This is definitely getting into the weeds about the particular details of this one specific dataflow analysis)</p>



<a name="168634335"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dataflow-based%20UseDef%20chains/near/168634335" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dataflow-based.20UseDef.20chains.html#168634335">(Jun 20 2019 at 21:02)</a>:</h4>
<p>anyway I have enough information now to at least file a bug</p>



<a name="168634346"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dataflow-based%20UseDef%20chains/near/168634346" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dataflow-based.20UseDef.20chains.html#168634346">(Jun 20 2019 at 21:02)</a>:</h4>
<p>that I can follow up on in the future</p>



<a name="168634365"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dataflow-based%20UseDef%20chains/near/168634365" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dataflow-based.20UseDef.20chains.html#168634365">(Jun 20 2019 at 21:02)</a>:</h4>
<p>I would personally be interested in exploring the refactoring you spoke of earlier</p>



<a name="168634386"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dataflow-based%20UseDef%20chains/near/168634386" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dataflow-based.20UseDef.20chains.html#168634386">(Jun 20 2019 at 21:02)</a>:</h4>
<p>where you said you removed the <code>on_entry</code> from the API for <code>statement_effect</code></p>



<a name="168634394"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dataflow-based%20UseDef%20chains/near/168634394" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dataflow-based.20UseDef.20chains.html#168634394">(Jun 20 2019 at 21:02)</a>:</h4>
<p>(or at least I think that's what you said)</p>



<a name="168634423"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dataflow-based%20UseDef%20chains/near/168634423" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dataflow-based.20UseDef.20chains.html#168634423">(Jun 20 2019 at 21:03)</a>:</h4>
<p>and if this <code>Borrows</code> code is the only thing stopping you</p>



<a name="168634424"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dataflow-based%20UseDef%20chains/near/168634424" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Dylan MacKenzie (ecstatic-morse) <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dataflow-based.20UseDef.20chains.html#168634424">(Jun 20 2019 at 21:03)</a>:</h4>
<p>Yes, I tried that as part of <a href="https://github.com/rust-lang/rust/pull/61787" target="_blank" title="https://github.com/rust-lang/rust/pull/61787">https://github.com/rust-lang/rust/pull/61787</a></p>



<a name="168634449"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dataflow-based%20UseDef%20chains/near/168634449" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dataflow-based.20UseDef.20chains.html#168634449">(Jun 20 2019 at 21:03)</a>:</h4>
<p>right, okay</p>



<a name="168634499"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dataflow-based%20UseDef%20chains/near/168634499" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dataflow-based.20UseDef.20chains.html#168634499">(Jun 20 2019 at 21:04)</a>:</h4>
<p>i'd be curious to explore doing it</p>



<a name="168634511"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dataflow-based%20UseDef%20chains/near/168634511" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dataflow-based.20UseDef.20chains.html#168634511">(Jun 20 2019 at 21:04)</a>:</h4>
<p>namely, I think an interesting experiment</p>



<a name="168634523"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dataflow-based%20UseDef%20chains/near/168634523" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dataflow-based.20UseDef.20chains.html#168634523">(Jun 20 2019 at 21:04)</a>:</h4>
<p>would be to change this <code>Borrows</code> code</p>



<a name="168634530"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dataflow-based%20UseDef%20chains/near/168634530" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dataflow-based.20UseDef.20chains.html#168634530">(Jun 20 2019 at 21:04)</a>:</h4>
<p>to stop reading <code>on_entry</code></p>



<a name="168634537"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dataflow-based%20UseDef%20chains/near/168634537" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dataflow-based.20UseDef.20chains.html#168634537">(Jun 20 2019 at 21:04)</a>:</h4>
<p>and <em>just</em> act as if <code>on_entry</code> is always the null-set.</p>



<a name="168634553"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dataflow-based%20UseDef%20chains/near/168634553" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dataflow-based.20UseDef.20chains.html#168634553">(Jun 20 2019 at 21:04)</a>:</h4>
<p>I'm speaking in particular about <code>kill_borrows_on_place</code></p>



<a name="168634586"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dataflow-based%20UseDef%20chains/near/168634586" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Dylan MacKenzie (ecstatic-morse) <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dataflow-based.20UseDef.20chains.html#168634586">(Jun 20 2019 at 21:05)</a>:</h4>
<p>But didn't we decide that <code>on_entry</code> <em>will</em> always be the null-set?</p>



<a name="168634588"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dataflow-based%20UseDef%20chains/near/168634588" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dataflow-based.20UseDef.20chains.html#168634588">(Jun 20 2019 at 21:05)</a>:</h4>
<p>but I can experiment with that on my own time tomorrow.</p>



<a name="168634596"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dataflow-based%20UseDef%20chains/near/168634596" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dataflow-based.20UseDef.20chains.html#168634596">(Jun 20 2019 at 21:05)</a>:</h4>
<blockquote>
<p>But didn't we decide that <code>on_entry</code> <em>will</em> always be the null-set?</p>
</blockquote>
<p>I haven't proven that to myself yet</p>



<a name="168634602"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dataflow-based%20UseDef%20chains/near/168634602" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Dylan MacKenzie (ecstatic-morse) <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dataflow-based.20UseDef.20chains.html#168634602">(Jun 20 2019 at 21:05)</a>:</h4>
<p>Since <code>accumulates_intrablock_state</code> is <code>false</code></p>



<a name="168634603"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dataflow-based%20UseDef%20chains/near/168634603" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dataflow-based.20UseDef.20chains.html#168634603">(Jun 20 2019 at 21:05)</a>:</h4>
<p>I <em>hope</em> its the case</p>



<a name="168634616"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dataflow-based%20UseDef%20chains/near/168634616" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Dylan MacKenzie (ecstatic-morse) <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dataflow-based.20UseDef.20chains.html#168634616">(Jun 20 2019 at 21:05)</a>:</h4>
<p>except in <code>state_for_location</code> that is XD</p>



<a name="168634698"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dataflow-based%20UseDef%20chains/near/168634698" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dataflow-based.20UseDef.20chains.html#168634698">(Jun 20 2019 at 21:06)</a>:</h4>
<p>I'm going to file a bug about this business, and assign it to myself</p>



<a name="168634711"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dataflow-based%20UseDef%20chains/near/168634711" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dataflow-based.20UseDef.20chains.html#168634711">(Jun 20 2019 at 21:06)</a>:</h4>
<p>hopefully I will get a chance to look more into it tomorrow.</p>



<a name="168634713"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dataflow-based%20UseDef%20chains/near/168634713" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Dylan MacKenzie (ecstatic-morse) <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dataflow-based.20UseDef.20chains.html#168634713">(Jun 20 2019 at 21:06)</a>:</h4>
<blockquote>
<p>But didn't we decide that <code>on_entry</code> <em>will</em> always be the null-set?</p>
</blockquote>
<p>That's a royal we I guess</p>



<a name="168634721"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dataflow-based%20UseDef%20chains/near/168634721" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Dylan MacKenzie (ecstatic-morse) <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dataflow-based.20UseDef.20chains.html#168634721">(Jun 20 2019 at 21:06)</a>:</h4>
<p>Okay, thanks for having a look</p>



<a name="168635996"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dataflow-based%20UseDef%20chains/near/168635996" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dataflow-based.20UseDef.20chains.html#168635996">(Jun 20 2019 at 21:24)</a>:</h4>
<p>okay, filed <a href="https://github.com/rust-lang/rust/issues/62007" target="_blank" title="https://github.com/rust-lang/rust/issues/62007">#62007</a> as a follow-up issue.</p>



<a name="168637518"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dataflow-based%20UseDef%20chains/near/168637518" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dataflow-based.20UseDef.20chains.html#168637518">(Jun 20 2019 at 21:47)</a>:</h4>
<p>I suppose I should have kept talking in here</p>



<a name="168637561"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dataflow-based%20UseDef%20chains/near/168637561" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dataflow-based.20UseDef.20chains.html#168637561">(Jun 20 2019 at 21:48)</a>:</h4>
<p>since I suspect we're coming to similar conclusions at the same time</p>



<a name="168637587"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dataflow-based%20UseDef%20chains/near/168637587" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dataflow-based.20UseDef.20chains.html#168637587">(Jun 20 2019 at 21:48)</a>:</h4>
<p>I am not at the moment sure exactly what the <code>local_map</code> holds.</p>



<a name="168637593"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dataflow-based%20UseDef%20chains/near/168637593" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dataflow-based.20UseDef.20chains.html#168637593">(Jun 20 2019 at 21:49)</a>:</h4>
<p>but a cursory review of the code makes me think that it actually does cover all places that have a local at their base</p>



<a name="168637626"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dataflow-based%20UseDef%20chains/near/168637626" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dataflow-based.20UseDef.20chains.html#168637626">(Jun 20 2019 at 21:49)</a>:</h4>
<p>(and therefore the idea has merit)</p>



<a name="168637629"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dataflow-based%20UseDef%20chains/near/168637629" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Dylan MacKenzie (ecstatic-morse) <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dataflow-based.20UseDef.20chains.html#168637629">(Jun 20 2019 at 21:49)</a>:</h4>
<p>Yeah, all I saw was that it calls <code>base_local</code> which (I believe) iterates through all field projections until it finds the base</p>



<a name="168637687"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dataflow-based%20UseDef%20chains/near/168637687" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dataflow-based.20UseDef.20chains.html#168637687">(Jun 20 2019 at 21:50)</a>:</h4>
<p>I need to hit the sack</p>



<a name="168637695"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dataflow-based%20UseDef%20chains/near/168637695" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Dylan MacKenzie (ecstatic-morse) <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dataflow-based.20UseDef.20chains.html#168637695">(Jun 20 2019 at 21:50)</a>:</h4>
<p>(Not sure how derefs are handled)</p>



<a name="168637697"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dataflow-based%20UseDef%20chains/near/168637697" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dataflow-based.20UseDef.20chains.html#168637697">(Jun 20 2019 at 21:50)</a>:</h4>
<p>but I'll try to look at this more tomorrow</p>



<a name="168637721"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dataflow-based%20UseDef%20chains/near/168637721" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Dylan MacKenzie (ecstatic-morse) <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dataflow-based.20UseDef.20chains.html#168637721">(Jun 20 2019 at 21:50)</a>:</h4>
<p>I'll make the change I have in mind in the meantime</p>



<a name="168637737"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dataflow-based%20UseDef%20chains/near/168637737" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dataflow-based.20UseDef.20chains.html#168637737">(Jun 20 2019 at 21:51)</a>:</h4>
<blockquote>
<p>(Not sure how derefs are handled)</p>
</blockquote>
<p>currently, they're just another Projection</p>



<a name="168637784"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dataflow-based%20UseDef%20chains/near/168637784" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dataflow-based.20UseDef.20chains.html#168637784">(Jun 20 2019 at 21:51)</a>:</h4>
<p>so they're handled the same way as <code>place.field</code> or <code>place[index]</code></p>



<a name="168637892"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dataflow-based%20UseDef%20chains/near/168637892" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Dylan MacKenzie (ecstatic-morse) <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dataflow-based.20UseDef.20chains.html#168637892">(Jun 20 2019 at 21:53)</a>:</h4>
<p>Okay, well I'll see what fails and maybe that will let you work a bit faster</p>



<a name="170499692"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dataflow-based%20UseDef%20chains/near/170499692" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Dylan MacKenzie (ecstatic-morse) <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dataflow-based.20UseDef.20chains.html#170499692">(Jul 09 2019 at 23:40)</a>:</h4>
<p>I started working on this again and have a functioning prototype in <a href="https://github.com/rust-lang/rust/issues/62547" target="_blank" title="https://github.com/rust-lang/rust/issues/62547">#62547</a>.</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>